package com.atnjupt.springboot03yaml.controller;

import com.atnjupt.springboot03yaml.config.MyDataSourece;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Wizarder
 * @create 2022-06-11 23:19
 */
@RestController
public class HelloController {
    @Value("${like[0]}")
    private String like;

    @Value("${user3[0].name}")
    private String username;

    @Value("${user2[1].name}")
    private String username1;

    @Autowired
    private MyDataSourece myDataSourece;

    @Value("${templDir}")
    private String templeDir;

    @Value("${dataDir1}")
    private String dataDir1;
    @RequestMapping("/hello")
    public String hellSpringBoot() {
        System.out.println("like=======>" + like);
        System.out.println("user3[0].name=======>" + username);
        System.out.println("user2[1].name=======>" + username1);
        System.out.println("mydatasource=======>" + myDataSourece);
        System.out.println("templeDir=======>" + templeDir);
        System.out.println("dataDir1=======>" + dataDir1);
        return "hello,Springboot!";
    }
}
